<!--********************************************************************
* Copyright© 2000 - 2025 SuperMap Software Co.Ltd. All rights reserved.
*********************************************************************-->
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title data-i18n="resources.title_thiessenAnalystDataset"></title>
    <script type="text/javascript" src="../js/include-web.js"></script>
</head>
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
<div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>
<script type="text/javascript" src="../../dist/leaflet/include-leaflet.js"></script>
<script type="text/javascript">
    var host = window.isLocal ? window.server : "https://iserver.supermap.io";
    var map, thiessenAnalystService, dsThiessenAnalystParameters, resultLayer,
        baseUrl = host + "/iserver/services/map-changchun/rest/maps/长春市区图",
        serviceUrl = host + "/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst";
    map = L.map('map', {
        crs: new L.supermap.CRS.NonEarthCRS({
            bounds: L.bounds([48.4, -7668.25], [8958.85, -55.58]),
            origin: L.point(48.4, -55.58)
        }),
        center: [-3375, 5105],
        maxZoom: 18,
        zoom: 1
    });
    new L.supermap.TiledMapLayer(baseUrl, {noWrap: true}).addTo(map);

    thiessenAnalystProcess();

    function thiessenAnalystProcess() {
        thiessenAnalystService = new L.supermap.SpatialAnalystService(serviceUrl);
        dsThiessenAnalystParameters = new L.supermap.DatasetThiessenAnalystParameters({
            dataset: "Factory@Changchun"
        });
        thiessenAnalystService.thiessenAnalysis(dsThiessenAnalystParameters).then(function (serviceResult) {
            resultLayer = L.geoJSON(serviceResult.result.regions, {weight: 2}).addTo(map);
        });
    }
</script>
</body>
</html>